<?xml version="1.0" encoding="UTF-8" ?>
<ui:composition template="/store/template/mainTemplate.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:f="http://java.sun.com/jsf/core">

	<ui:define name="title">
        Chocolor:View order
    </ui:define>

	<ui:define name="content">
		<p:panelGrid style="margin-top:20px; width:100%; border-style:hidden"
			id="orderView">
			<f:facet name="header">
				<p:row>
					<p:column style="border-style:hidden" colspan="2">Your order: </p:column>
				</p:row>
			</f:facet>

			<p:row>
				<p:column style="width:200px; border-style:hidden">Client:</p:column>
				<p:column style="border-style:hidden">#{clientViewBean.getClientEmail()}</p:column>
				<p:column
					style="width:10%; border-style:hidden; background-color:white"></p:column>
			</p:row>

			<p:row>
				<p:column style="border-style:hidden">Order date:</p:column>
				<p:column style="border-style:hidden">#{viewOrderBean.order.orderDate}</p:column>

			</p:row>

			<p:row>
				<p:column style="border-style:hidden">Article:	</p:column>
				<p:column style="border-style:hidden">#{viewOrderBean.order.article.articleId}	</p:column>
			</p:row>

			<p:row>
				<p:column style="border-style:hidden">Logotype: </p:column>
				<p:column style="border-style:hidden">
					<h:form>
						<p:commandButton value="View logotype" ajax="false"
							immediate="true">
							<p:fileDownload
								value="#{viewOrderBean.getBufferDownloadLogotype()}" />
						</p:commandButton>
					</h:form>
				</p:column>

			</p:row>
			<p:row>
				<p:column style="border-style:hidden">Sketch: </p:column>
				<p:column style="border-style:hidden">
					<c:if test="#{viewOrderBean.order.pattern.sketch == null}">
						Sketch is not yet available for your order
					</c:if>
					<c:if test="#{viewOrderBean.order.pattern.sketch != null}">
						<h:form>
							<p:commandButton value="View logotype" ajax="false"
								immediate="true">
								<p:fileDownload
									value="#{viewOrderBean.getBufferDownloadLogotype()}" />
							</p:commandButton>
						</h:form>
					</c:if>
				</p:column>

			</p:row>

			<p:row>
				<p:column style="border-style:hidden">Inscription: </p:column>
				<p:column style="border-style:hidden">#{viewOrderBean.order.pattern.inscription}
				</p:column>

			</p:row>

			<p:row>
				<p:column style="border-style:hidden">Frame: </p:column>
				<p:column style="border-style:hidden">#{viewOrderBean.order.pattern.hasFrame}
				</p:column>

			</p:row>

			<p:row>
				<p:column style="border-style:hidden">Chocolate type: </p:column>
				<p:column style="border-style:hidden">#{viewOrderBean.order.chocolate.rawType}
				</p:column>

			</p:row>

			<p:row>
				<p:column style="border-style:hidden">Packing: </p:column>
				<p:column style="border-style:hidden">#{viewOrderBean.order.packing.packingType}
				</p:column>

			</p:row>

			<p:row>
				<p:column style="border-style:hidden">Logo colour: </p:column>
				<p:column style="border-style:hidden">#{viewOrderBean.order.palette.logoColor}
				</p:column>

			</p:row>

			<p:row>
				<p:column style="border-style:hidden">Inscription colour: </p:column>
				<p:column style="border-style:hidden">#{viewOrderBean.order.palette.inscriptionColor}
				</p:column>

			</p:row>
			<p:row>
				<p:column style="border-style:hidden">Plato colour: </p:column>
				<p:column style="border-style:hidden">#{viewOrderBean.order.palette.platoColor}
					</p:column>
			</p:row>

			<p:row>
				<p:column style="border-style:hidden">Body colour: </p:column>
				<p:column style="border-style:hidden">#{viewOrderBean.order.palette.bodyColor}
					</p:column>

			</p:row>


			<p:row>
				<p:column style="border-style:hidden">Quantity: </p:column>
				<p:column style="border-style:hidden">#{viewOrderBean.order.quantity}
					</p:column>

			</p:row>

			<f:facet name="footer">
				<p:row>
					<p:column style="text-align:left; border-style:hidden" colspan="2">
						<h:form>
							<p:commandButton value="Edit order" id="editOrder" ajax="false"
								action="#{viewOrderBean.editOrder()}"
								disabled="false" icon="ui-icon-pencil" />
						</h:form>
					</p:column>
				</p:row>

			</f:facet>
		</p:panelGrid>
	</ui:define>
</ui:composition>
